package com.huzz.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
* 系统用户 新建Model
*
* @author 童年的纸飞机
* @since 2023-06-06 20:05
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@ApiModel("系统用户 新建Model Args")
public class SysUserCreateModel implements Serializable {

    @NotBlank(message = "username不能为null,也不能为空串")
    @ApiModelProperty(value = "用户名")
    private String username;

    // @NotBlank(message = "password不能为null,也不能为空串")
    // @ApiModelProperty(value = "密码")
    // private String password;

    @NotNull(message = "sex不能为空")
    @ApiModelProperty(value = "性别(男:1,女0)")
    private Integer sex;

    @ApiModelProperty(value = "出生年月")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date birth;

    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "phone填写格式不正确")
    @ApiModelProperty(value = "电话")
    private String phone;

    @Pattern(regexp = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$", message = "email填写格式不正确")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "昵称")
    private String nickname;

    @ApiModelProperty(value = "部门id")
    private Integer departmentId;

    @ApiModelProperty(value = "头像")
    private String cover;

    @NotNull(message = "status不能为空")
    @ApiModelProperty(value = "状态(0禁用, 1开启)")
    private Integer status;

}